package com.cy.law.db.entity;

import com.cy.law.db.strategy.GenericStrategy;
import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.util.Objects;

@Entity
@Table(name = "hk_device", schema = "zhifayi", catalog = "")
public class HkDevice {
    private String cameraId;
    private String name;
    private String extraField;
    private String latitude;
    private String controlUnitName;
    private String description;
    private String isOnline;
    private Long updateTime;
    private String cameraType;
    private Long createTime;
    private String decodeTag;
    private String indexCode;
    private String pixel;
    private String parentIndexCode;
    private String longitude;

    @Basic
    @Column(name = "camera_id")
    public String getCameraId() {
        return cameraId;
    }

    public void setCameraId(String cameraId) {
        this.cameraId = cameraId;
    }

    @Basic
    @Column(name = "name")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Basic
    @Column(name = "extra_field")
    public String getExtraField() {
        return extraField;
    }

    public void setExtraField(String extraField) {
        this.extraField = extraField;
    }

    @Basic
    @Column(name = "latitude")
    public String getLatitude() {
        return latitude;
    }

    public void setLatitude(String latitude) {
        this.latitude = latitude;
    }

    @Basic
    @Column(name = "control_unit_name")
    public String getControlUnitName() {
        return controlUnitName;
    }

    public void setControlUnitName(String controlUnitName) {
        this.controlUnitName = controlUnitName;
    }

    @Basic
    @Column(name = "description")
    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Basic
    @Column(name = "is_online")
    public String getIsOnline() {
        return isOnline;
    }

    public void setIsOnline(String isOnline) {
        this.isOnline = isOnline;
    }

    @Basic
    @Column(name = "update_time")
    public Long getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Long updateTime) {
        this.updateTime = updateTime;
    }

    @Basic
    @Column(name = "camera_type")
    public String getCameraType() {
        return cameraType;
    }

    public void setCameraType(String cameraType) {
        this.cameraType = cameraType;
    }

    @Basic
    @Column(name = "create_time")
    public Long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Long createTime) {
        this.createTime = createTime;
    }

    @Basic
    @Column(name = "decode_tag")
    public String getDecodeTag() {
        return decodeTag;
    }

    public void setDecodeTag(String decodeTag) {
        this.decodeTag = decodeTag;
    }

    @Id
    @GenericGenerator(name = "HkDevice", strategy = GenericStrategy.ASSIGNED)
    @GeneratedValue(generator = "HkDevice")
    @Column(name = "index_code")
    public String getIndexCode() {
        return indexCode;
    }

    public void setIndexCode(String indexCode) {
        this.indexCode = indexCode;
    }

    @Basic
    @Column(name = "pixel")
    public String getPixel() {
        return pixel;
    }

    public void setPixel(String pixel) {
        this.pixel = pixel;
    }

    @Basic
    @Column(name = "parent_index_code")
    public String getParentIndexCode() {
        return parentIndexCode;
    }

    public void setParentIndexCode(String parentIndexCode) {
        this.parentIndexCode = parentIndexCode;
    }

    @Basic
    @Column(name = "longitude")
    public String getLongitude() {
        return longitude;
    }

    public void setLongitude(String longitude) {
        this.longitude = longitude;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        HkDevice hkDevice = (HkDevice) o;
        return Objects.equals(cameraId, hkDevice.cameraId) &&
                Objects.equals(name, hkDevice.name) &&
                Objects.equals(extraField, hkDevice.extraField) &&
                Objects.equals(latitude, hkDevice.latitude) &&
                Objects.equals(controlUnitName, hkDevice.controlUnitName) &&
                Objects.equals(description, hkDevice.description) &&
                Objects.equals(isOnline, hkDevice.isOnline) &&
                Objects.equals(updateTime, hkDevice.updateTime) &&
                Objects.equals(cameraType, hkDevice.cameraType) &&
                Objects.equals(createTime, hkDevice.createTime) &&
                Objects.equals(decodeTag, hkDevice.decodeTag) &&
                Objects.equals(indexCode, hkDevice.indexCode) &&
                Objects.equals(pixel, hkDevice.pixel) &&
                Objects.equals(parentIndexCode, hkDevice.parentIndexCode) &&
                Objects.equals(longitude, hkDevice.longitude);
    }

    @Override
    public int hashCode() {
        return Objects.hash(cameraId, name, extraField, latitude, controlUnitName, description, isOnline, updateTime, cameraType, createTime, decodeTag, indexCode, pixel, parentIndexCode, longitude);
    }
}
